home *** CD-ROM | disk | FTP | other *** search
/ PCMania 39 / PCMania CD39_2.iso / pcmania / mod39 / modinfo.c < prev    next >
C/C++ Source or Header  |  1990-11-22  |  24KB  |  366 lines

  1. //    *** ------------------------------------- ***
  2. //    *       Mod - Info , programado por         *
  3. //    *          Esteban Moreno Valdés            *
  4. //    *   ( Colaborador de la revista Pcmanía )   *
  5. //    *** ------------------------------------- ***
  6.  
  7. #include <stdio.h>
  8. #include <conio.h>
  9. #include <dos.h>
  10. #include <process.h>
  11. #include <string.h>
  12. #include <fcntl.h>
  13.  
  14. #define BYTE unsigned char
  15. #define WORD unsigned  int
  16.  
  17.  // Informaciones generales del fichero MOD
  18.  
  19.   BYTE file_name[16];
  20.   BYTE song_name[21];                 // Título de la canción
  21.   BYTE patrones;                      // Número de patrones
  22.   BYTE constant;                      // Constante
  23.   BYTE tabla[129];                    // Patterns
  24.   BYTE id[5];                         // M.K.
  25.  
  26.  // Informaciones de cada instrumento
  27.  
  28.  struct {
  29.  
  30.     BYTE name[23];               // Nombre del sample
  31.     WORD length;                 // Tamaño del sample
  32.     BYTE fine;                   // Finetune
  33.     BYTE vol;                    // Volumen del sample
  34.     WORD orep;                   // Offset de repetición
  35.     WORD lrep;                   // Longitud de repetición
  36.  
  37.     } SAMPLE[31];
  38.  
  39.     // A continuación aparecerá la información codificada de la pantalla
  40.     // en modo texto. Si no lo entendéis tranquilos puesto que esto
  41.     // no entra dentro de nuestro temario.
  42.  
  43.  BYTE screen [] = {
  44.  
  45.     32, 94, 32, 94, 77, 94, 111, 94, 100, 94, 45, 94, 73, 94, 110, 94, 102, 94, 111, 94, 32, 94, 32, 94, 124, 94, 32, 94,
  46.     32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 80, 94, 114, 94, 111, 94, 103, 94, 114, 94, 97, 94, 109, 94,
  47.     97, 94, 100, 94, 111, 94, 32, 94, 112, 94, 111, 94, 114, 94, 32, 94, 69, 94, 115, 94, 116, 94, 101, 94, 98, 94, 97, 94,
  48.     110, 94, 32, 94, 77, 94, 111, 94, 114, 94, 101, 94, 110, 94, 111, 94, 32, 94, 86, 94, 97, 94, 108, 94, 100, 94, 130, 94,
  49.     115, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 124, 94, 32, 94, 32, 94,
  50.     77, 94, 111, 94, 100, 94, 45, 94, 73, 94, 110, 94, 102, 94, 111, 94, 32, 94, 32, 94, 176, 16, 176, 16, 176, 16, 176, 16,
  51.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  52.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  53.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  54.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  55.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  56.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  57.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 78, 73, 78, 110, 78, 102, 78, 111, 78, 114, 78, 109, 78, 97, 78,
  58.     99, 78, 105, 78, 111, 78, 110, 78, 101, 78, 115, 78, 32, 78, 103, 78, 101, 78, 110, 78, 101, 78, 114, 78, 97, 78, 108, 78,
  59.     101, 78, 115, 78, 32, 78, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  60.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  61.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  62.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  63.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  64.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  65.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  66.     176, 16, 176, 16, 176, 16, 176, 16, 84, 78, 97, 78, 98, 78, 108, 78, 97, 78, 32, 78, 100, 78, 101, 78, 32, 78, 112, 78,
  67.     97, 78, 116, 78, 116, 78, 101, 78, 114, 78, 110, 78, 115, 78, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  68.     176, 16, 32, 30, 32, 30, 78, 30, 111, 30, 109, 30, 98, 30, 114, 30, 101, 30, 32, 30, 100, 30, 101, 30, 108, 30, 32, 30,
  69.     102, 30, 105, 30, 99, 30, 104, 30, 101, 30, 114, 30, 111, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30,
  70.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  71.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  72.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  73.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 84, 30,
  74.     161, 30, 116, 30, 117, 30, 108, 30, 111, 30, 32, 30, 100, 30, 101, 30, 32, 30, 108, 30, 97, 30, 32, 30, 99, 30, 97, 30,
  75.     110, 30, 99, 30, 105, 30, 162, 30, 110, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  76.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  77.     32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  78.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  79.     32, 30, 32, 30, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 78, 30, 163, 30, 109, 30, 101, 30, 114, 30,
  80.     111, 30, 32, 30, 100, 30, 101, 30, 32, 30, 112, 30, 97, 30, 116, 30, 116, 30, 101, 30, 114, 30, 110, 30, 115, 30, 32, 30,
  81.     32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  82.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16,
  83.     176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  84.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16,
  85.     176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 86, 30, 97, 30, 108, 30, 111, 30, 114, 30, 32, 30, 99, 30, 111, 30, 110, 30,
  86.     115, 30, 116, 30, 97, 30, 110, 30, 116, 30, 101, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30,
  87.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  88.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30,
  89.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  90.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30,
  91.     32, 30, 73, 30, 110, 30, 100, 30, 101, 30, 110, 30, 116, 30, 105, 30, 102, 30, 105, 30, 99, 30, 97, 30, 99, 30, 105, 30,
  92.     162, 30, 110, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  93.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  94.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  95.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  96.     32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  97.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  98.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  99.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  100.     178, 16, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  101.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  102.     178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  103.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  104.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  105.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  106.     176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  107.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16,
  108.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 78, 73, 78, 110, 78, 102, 78, 111, 78, 114, 78,
  109.     109, 78, 97, 78, 99, 78, 105, 78, 111, 78, 110, 78, 101, 78, 115, 78, 32, 78, 100, 78, 101, 78, 32, 78, 99, 78, 97, 78,
  110.     100, 78, 97, 78, 32, 78, 105, 78, 110, 78, 115, 78, 116, 78, 114, 78, 117, 78, 109, 78, 101, 78, 110, 78, 116, 78, 111, 78,
  111.     32, 78, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30,
  112.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  113.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  114.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  115.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  116.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  117.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  118.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  119.     32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 83, 30, 97, 30, 109, 30, 112, 30, 108, 30,
  120.     101, 30, 32, 30, 110, 30, 163, 30, 109, 30, 101, 30, 114, 30, 111, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  121.     32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  122.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 176, 16,
  123.     176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  124.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16,
  125.     176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 78, 30, 111, 30, 109, 30, 98, 30, 114, 30, 101, 30, 32, 30, 32, 30, 32, 30,
  126.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30,
  127.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  128.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30,
  129.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  130.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30,
  131.     32, 30, 76, 30, 111, 30, 110, 30, 103, 30, 105, 30, 116, 30, 117, 30, 100, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  132.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  133.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  134.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  135.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  136.     32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 70, 30, 105, 30, 110, 30,
  137.     101, 30, 116, 30, 117, 30, 110, 30, 101, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  138.     32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  139.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  140.     32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  141.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  142.     178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 86, 30, 111, 30, 108, 30, 117, 30, 109, 30, 101, 30, 110, 30,
  143.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  144.     58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  145.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16,
  146.     176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  147.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16,
  148.     176, 16, 32, 30, 32, 30, 76, 30, 111, 30, 111, 30, 112, 30, 32, 30, 115, 30, 116, 30, 97, 30, 114, 30, 116, 30, 32, 30,
  149.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30,
  150.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  151.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30,
  152.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  153.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 76, 30,
  154.     111, 30, 111, 30, 112, 30, 32, 30, 101, 30, 110, 30, 100, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  155.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  156.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  157.     32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  158.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  159.     32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  160.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  161.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  162.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  163.     176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
  164.     32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16,
  165.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  166.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  167.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  168.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  169.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  170.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 85, 30,
  171.     115, 30, 97, 30, 32, 30, 108, 30, 97, 30, 32, 30, 116, 30, 101, 30, 99, 30, 108, 30, 97, 30, 115, 30, 32, 30, 60, 30,
  172.     45, 30, 32, 30, 121, 30, 32, 30, 45, 30, 62, 30, 32, 30, 112, 30, 97, 30, 114, 30, 97, 30, 32, 30, 99, 30, 97, 30,
  173.     109, 30, 98, 30, 105, 30, 97, 30, 114, 30, 32, 30, 100, 30, 101, 30, 32, 30, 105, 30, 110, 30, 115, 30, 116, 30, 114, 30,
  174.     117, 30, 109, 30, 101, 30, 110, 30, 116, 30, 111, 30, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  175.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  176.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  177.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  178.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  179.     178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
  180.     178, 16, 178, 16, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  181.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  182.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  183.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  184.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  185.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  186.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
  187.     176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16
  188.     };
  189.  
  190.  void set_video_mode(BYTE);        // Establece nuevo modo de pantalla
  191.  void get_info(BYTE fichero[16]);  // Lee información del fichero
  192.  void display_screen();            // Visualiza el entorno
  193.  void display_inform();            // Imprime las informaciones generales
  194.  void no_cursor();                 // Elimina el molesto cursor de la pantalla
  195.  void fin();                       // Muestra el mensaje final
  196.  WORD xchange(WORD);               // Pasa al formato BACKWORDS
  197.  
  198.  void main(int argc, BYTE *argv[])
  199.  {
  200.     no_cursor();
  201.     textattr(30);
  202.     if (argc<2) { printf("Error    : Falta parámetro requerido.\n");
  203.               printf("Sintaxis : Modinfo fichero.MOD.\n\n");
  204.               exit(0);
  205.     }
  206.     set_video_mode(3);         // Modo alfanumérico
  207.     get_info(argv[1]);
  208.     no_cursor();
  209.     display_screen();
  210.     display_inform();
  211.     fin();
  212.  }
  213.  
  214.  void set_video_mode(BYTE mode)
  215.  {
  216.     asm {
  217.         xor    ah,ah
  218.         mov    al,mode
  219.         int    10h
  220.     }
  221.  }
  222.  
  223.  void get_info(BYTE fichero[])
  224.  {
  225.     int handle;
  226.     BYTE i;
  227.     unsigned bytes_read;
  228.  
  229.     strcpy(file_name,fichero);        // Copia una cadena
  230.  
  231.     if ((_dos_open(fichero,O_RDONLY,&handle))!=0) {
  232.        printf("\nError : No se puede abrir el fichero especificado.\n\n");
  233.        exit(0);
  234.     }
  235.  
  236.     _dos_read(handle,song_name,20,&bytes_read);
  237.  
  238.     for (i=0;i<=30;i++) {
  239.         _dos_read(handle,SAMPLE[i].name,22,&bytes_read);
  240.         _dos_read(handle,&SAMPLE[i].length,2,&bytes_read);
  241.         _dos_read(handle,&SAMPLE[i].fine,1,&bytes_read);
  242.         _dos_read(handle,&SAMPLE[i].vol,1,&bytes_read);
  243.         _dos_read(handle,&SAMPLE[i].orep,2,&bytes_read);
  244.         _dos_read(handle,&SAMPLE[i].lrep,2,&bytes_read);
  245.  
  246.         // Fijaos bien en la modificaciones que llevo a cabo
  247.         // en las siguientes variables
  248.  
  249.         SAMPLE[i].length=xchange(SAMPLE[i].length);
  250.         SAMPLE[i].orep=xchange(SAMPLE[i].orep);
  251.         SAMPLE[i].lrep=xchange(SAMPLE[i].lrep);
  252.         if (SAMPLE[i].lrep==1) { SAMPLE[i].lrep=0; }
  253.     }
  254.         // De momento no multiplico por dos, sino que los haré
  255.         // a la hora de imprimir dichas variables, para que
  256.         // se entienda mejor.
  257.  
  258.         _dos_read(handle,&patrones,1,&bytes_read);
  259.         _dos_read(handle,&constant,1,&bytes_read);
  260.         _dos_read(handle,tabla,128,&bytes_read);
  261.         _dos_read(handle,id,4,&bytes_read);
  262.  
  263.         _dos_close(handle);
  264.  
  265.         if (!strcmp(id,"M.K")) { printf("Error : El fichero cargado no es un standard\n");
  266.                   printf("        de cuatro canales.\n\n");
  267.                   exit(0);
  268.         }
  269.  }
  270.  
  271.  WORD xchange(WORD wrd)
  272.  {
  273.     asm {
  274.         mov     ax,wrd
  275.         xchg    ah,al
  276.         mov     wrd,ax
  277.     }
  278.  
  279.     return(wrd);
  280.  }
  281.  
  282.  void display_screen()
  283.  {
  284.     asm {
  285.         mov     ax,0b800h
  286.         mov     es,ax
  287.         xor     di,di
  288.         push    ds
  289.         mov     ax,seg screen
  290.         mov     ds,ax
  291.         mov     si,offset screen
  292.         mov     cx,2000
  293.  
  294.     }
  295.  
  296.     bucle:;
  297.  
  298.     asm {
  299.         mov     ax,ds:[si]      // Aquí toda la información conte-
  300.         mov     es:[di],ax      // nida en el enorme array del prin-
  301.         add     si,2            // cipio es pasada a la pantalla
  302.         add     di,2            // en forma de carácteres
  303.         loop    bucle
  304.         pop     ds
  305.     }
  306. }
  307.  
  308. void no_cursor()
  309. {
  310.     asm {
  311.         mov    ah,1        // Establece el nuevo tamaño del cursor
  312.         mov    cl,0
  313.         mov    ch,1
  314.         int    10h
  315.     }
  316. }
  317.  
  318. void display_inform()
  319. {
  320.     BYTE i=0,x,y=6,temp=patrones-1,c=0;
  321.     char r=0;
  322.  
  323.     textattr(94);
  324.     for (y=6;y<=21;y++) {
  325.         x=56;
  326.         for (;x<=77;x+=3,i++) {
  327.             gotoxy(x,y);
  328.             cprintf("%02X",tabla[i]);
  329.             if (temp--<=0) textattr(30);
  330.         }
  331.     }
  332.  
  333.     gotoxy(29,5); printf("%22s",file_name);
  334.     gotoxy(29,6); printf("%22s",song_name);
  335.     gotoxy(35,7); printf("%02Xh    ·     %02ud",patrones,patrones);
  336.     gotoxy(35,8); printf("%02Xh    ·    %03ud",constant,constant);
  337.     gotoxy(29,9); printf("%22s",id);
  338.     textattr(78);
  339.     gotoxy(63,24); cprintf("·PCMANIA·");
  340.  
  341.     while (r!=27) {
  342.  
  343.     gotoxy(48,14); printf("%2dd",c+1);
  344.     gotoxy(29,15); printf("%22s",SAMPLE[c].name);
  345.     gotoxy(35,16); printf("%04Xh  ·  %05ud",SAMPLE[c].length*2,SAMPLE[c].length*2);
  346.     gotoxy(35,17); printf("%02Xh    ·     %02ud",SAMPLE[c].fine,SAMPLE[c].fine);
  347.     gotoxy(35,18); printf("%02Xh    ·     %02ud",SAMPLE[c].vol,SAMPLE[c].vol);
  348.     gotoxy(35,19); printf("%04Xh  ·  %05ud",SAMPLE[c].orep*2,SAMPLE[c].orep*2);
  349.     gotoxy(35,20); printf("%04Xh  ·  %05ud",SAMPLE[c].lrep*2+SAMPLE[c].orep*2,
  350.                           SAMPLE[c].lrep*2+SAMPLE[c].orep*2);
  351.     r=getch();
  352.     if (r=='4') { if(c--<=0) c=30; }
  353.        else if (r=='6') { if(c++>=30) c=0; }
  354.     }
  355. }
  356.  
  357. void fin()
  358. {
  359.     set_video_mode(3);
  360.     printf("╔════════════════════════════════════════╗\n");
  361.     printf("║             · Mod-Info ·               ║\n");
  362.     printf("║  Programado por Esteban Moreno Valdés  ║\n");
  363.     printf("║        para la revista Pcmanía         ║\n");
  364.     printf("╚════════════════════════════════════════╝\n\n");
  365. }
  366.